package com.dqx.haoqiu.mvp.module.guide;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

public class GuideAdapter extends FragmentPagerAdapter {
    private int[] images;

    public GuideAdapter(FragmentManager fm, int[] images) {
        super(fm);
        this.images = images;
    }

    @Override
    public Fragment getItem(int position) {
        boolean isLastItem = (position == images.length - 1);
        return GuideItemFragment.newInstance(images[position], isLastItem);
    }

    @Override
    public int getCount() {
        return images.length;
    }
}
